<template>
	<div id="detail">
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">发现</h1>
		</header>
		<div class="mui-content">
			<div class="top">
				<div class="left">
					<img :src="detail.logo" />
				</div>
				<div class="center">
					<p class="title">{{detail.productName}}</p>
					<div class="starDiv">
						<ul>
							<li><img src="../assets/images/list/s2.png"></li>
							<li><img src="../assets/images/list/s2.png"></li>
							<li><img src="../assets/images/list/s2.png"></li>
							<li><img src="../assets/images/list/s2.png"></li>
							<li><img src="../assets/images/list/s2.png"></li>
						</ul><span class="star___3uc7E">成功率</span></div>
				</div>
				<div class="right" v-html="tags">
					<span>急速放贷</span>
				</div>
			</div>
			<div class="rate">
				<div class="item">
					<p class="title">参考日利率</p>
					<p class="info">{{detail.loanRate}}</p>
				</div>
				<div class="item2">
					<p class="title">贷款额度</p>
					<p class="info"> {{detail.loanLimit}}</p>
				</div>
			</div>
			<div class="hline"></div>
			<div class="spec">
				<div class="spec-title"><img src="../assets/images/list/find_icon1.png" />产品特点</div>
				<p>
					{{detail.description}}
				</p>
			</div>
			<div class="spec">
				<div class="spec-title"><img src="../assets/images/list/find_icon2.png" style="background-color: transparent;" />贷款期限</div>
				<p>
					{{detail.loanTerm}}
				</p>
			</div>
			<div class="spec">
				<div class="spec-title"><img src="../assets/images/list/find_icon3.png" />申请材料</div>
				<p>{{detail.materialRequested}}</p>
			</div>
		</div>
	</div>
</template>

<script>
	import libs from "@/assets/js/libs";
	import rules from '@/assets/js/rules';
	export default {
		data() {
			return {
				detail: {},
				tags:'',
			}
		},
		mounted() {
			//获取列表数据
			libs.request({
				url: `/product/detail/1`,
				method: 'get',
			}).then(res => {
				this.detail = res;
				this.resove(res.tags);
			});
		},
		methods: {
			resove(array){
				let aa = array?array.split(",") : [];
				console.log(array)
				let str = '';
				for(let i = 0;i<aa.length;i++){
					str+='<span>'+aa[i]+'</span>';
				}
				this.tags = str;
      },
      resoveStar(star){

      }
		}
	}
</script>

<style lang="scss">
	@import "../assets/css/funcs.scss";
	@import '../assets/css/common.scss';
	#detail {
		.mui-content {
			background-color: #f5f5f5;
		}
		.top {
			height: 102px;
			background-color: #fff;
			padding: 0 3%;
			.left {
				width: 50px;
				height: 50px;
				margin-top: 25px;
				img {
					width: 100%;
				}
			}
			.center {
				float: left;
				margin-top: 25px;
				margin-left: 10px;
				.title {
					font-size: pxToRem(31px);
					color: #000000;
					position: relative;
					top: 5px;
				}
				.starDiv {
					font-size: pxToRem(25px);
					color: rgba(255, 136, 0, 1);
					position: relative;
					top: -5px;
					ul li {
						float: left;
						width: 10px;
						margin-left: 2px;
						img {
							width: 100%;
							position: relative;
							top: 5px;
						}
					}
					span {
						float: left;
					}
					ul {
						float: right;
					}
				}
			}
			.right {
				margin-top: 30px;
				text-align: center;
				color: #FF8800;
				font-size: pxToRem(23px);
				span{
					border: 1px solid #FF8800;
					margin: 0 2px;
					padding: 0 2px;
					border-radius: 4px;
				}
			}
		}
		.rate {
			height: 63px;
			background-color: #fff;
			padding: 0px 3%;
			margin-top: 8px;
			div {
				float: left;
				line-height: 8px;
				margin-top: 20px;
				text-align: center;
			}
			.item {
				margin-left: 15%;
			}
			.item2 {
				margin-left: 33%;
			}
			.item,
			.item2 {
				.title {
					font-size: pxToRem(27px);
					color: #010101;
				}
				.info {
					font-size: pxToRem(23px);
					color: #FF8800;
					position: relative;
					top: 3px;
				}
			}
		}
		.hline {
			height: 33px;
			background-color: #dad3d3;
			width: 1px;
			margin: auto;
			position: relative;
			top: -45px;
		}
		.spec {
			background-color: #fff;
			position: relative;
			top: -24px;
			border-bottom: 1px solid #F5F5F5;
			padding: 20px 3% 10px 3%;
			.spec-title {
				font-size: pxToRem(27px);
				color: rgba(0, 0, 0, 1);
			}
			img {
				width: 6%;
				background-color: #f5f5f5;
			}
			p {
				padding-left: 6%;
				font-size: pxToRem(23px);
				color: #999999;
			}
		}
	}
</style>
